% TEST_ID: LANG-EXPAND-0106
% CATEGORY: language/string
% 测试 string 的字串提取

function test_string_extractAfter()

str = "The quick brown fox";
newStr = extractAfter(str,"quick ");
result = "brown fox";
assert_istrue(newStr, result);

str = ["The quick brown fox jumps";"over the lazy dog"];
newStr = extractAfter(str,["quick ";"the "]);
result = ["brown fox jumps"
    "lazy dog"];
assert_istrue(newStr, result);

str = "Edgar Allen Poe";
newStr = extractAfter(str,12);
result = "Poe";
assert_istrue(newStr, result);

str = ["Edgar Allen Poe";"Louisa May Alcott"];
newStr = extractAfter(str,[12;11]);
result = ["Poe"
    "Alcott"];
assert_istrue(newStr, result);

str = "Edgar Allen Poe"
newStr = extractAfter(str,12);
assert_istrue(class(newStr), 'string');
end

function assert_istrue(x,y)
    assert(x == y);
end